package com.mobisys.live.http;

import org.springframework.context.annotation.Bean;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * Created by zhuo on 2018-01-24.
 */
public class RestTemplateUtil {
    @Bean
    public static RestTemplate restTemplate(){
        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
        requestFactory.setConnectTimeout(100000);
        requestFactory.setReadTimeout(10000);


        RestTemplate restTemplate = new RestTemplate(requestFactory);

        return restTemplate;
    }
}
